package com.sailorj.itools.gui;

import javax.swing.*;

/**
 * @author by laugh on 2016/4/12.
 */
public class ConfigForm {
    private JTextField textFieldapikey;
    private JLabel labelapikey;
    private JPanel jpanel;
    private JTextField textFieldkeyfrom;
    private JLabel labelkeyfrom;
    private static ConfigForm configForm = null;

    public static JPanel getConfigForm() {
        if (configForm == null) {
            configForm = new ConfigForm();
        }

        return configForm.jpanel;
    }

    public static JTextField getTextFieldApiKey() {
        if (configForm == null) {
            configForm = new ConfigForm();
        }
        return configForm.textFieldapikey;
    }

    public static void setKeyName(String keyName) {
        if (configForm == null) {
            configForm = new ConfigForm();
        }
        configForm.labelapikey.setText(keyName);
    }

    public static JTextField getTextFieldKeyFrom() {
        if (configForm == null) {
            configForm = new ConfigForm();
        }
        return configForm.textFieldkeyfrom;
    }

    public static void setKeyFromName(String keyFromName) {
        if (configForm == null) {
            configForm = new ConfigForm();
        }
        configForm.labelkeyfrom.setText(keyFromName);
    }

}
